﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Evaluant.NLinq.Expressions
{
    public class QueryBody : Expression
    {
        public QueryBody(ClauseList clauses, SelectOrGroupClause selectOrGroup, QueryContinuation continuation)
        {
            this.clauses = clauses ?? new ClauseList();
            this.selectOrGroup = selectOrGroup;
            this.continuation = continuation;
        }

        private ClauseList clauses;

        public ClauseList Clauses
        {
            get { return clauses; }
            set { clauses = value; }
        }

        private SelectOrGroupClause selectOrGroup;

        public SelectOrGroupClause SelectOrGroup
        {
            get { return selectOrGroup; }
            set { selectOrGroup = value; }
        }

        private QueryContinuation continuation;

        public QueryContinuation Continuation
        {
            get { return continuation; }
            set { continuation = value; }
        }

        public override void Accept(NLinqVisitor visitor)
        {
            visitor.Visit(this);
        }

        public override ExpressionTypes ExpressionType
        {
            get { return ExpressionTypes.QueryBody; }
        }
    }
}
